package top.crossrun.webview.bridge.core.pls;

public class DefaultWebViewPlugin extends WebViewBridgePlugin {
    private WebViewBridgeHandler bridgeHandler;

    public DefaultWebViewPlugin(String pluginName, WebViewBridgeHandler bridgeHandler, boolean needContext) {
        super(pluginName, needContext);
        this.bridgeHandler = bridgeHandler;
    }

    @Override
    public void handlerBridgeMsg(String msg, BridgeCallBackFunction callBackFunction) {
        if (bridgeHandler != null) {
            bridgeHandler.handlerBridgeMsg(msg, callBackFunction);
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        bridgeHandler = null;
    }
}
